include<bits / stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n'
#define REP(i, x, y) for (auto i = (x), _##i = (y); i < _##i; ++i)
#define PER(i, x, y) for (auto i = (x), _##i = (y); i > _##i; --i)

template<class T=int>
inline void OO(const T &coll, const char *del = ",") {
    copy(coll.begin(), coll.end(), ostream_iterator<decltype(*coll.begin())>(cerr, del));
    cerr << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cout.tie(nullptr);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> v(n, 1);
    partial_sum(v.begin(), v.end(), v.begin());
    do {
        copy(v.begin(), v.end(), ostream_iterator<int>(cout, ""));
        cout << endl;
    } while (next_permutation(v.begin(), v.end()));
    return 0;
}